home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / DCLAP 6d / dclap6d / DClap / DTabSelect.h < prev    next >
Text File  |  1996-07-05  |  2KB  |  83 lines

  1. // DTabSelect.h
  2. // d.g.gilbert
  3.  
  4. #ifndef _DTABSELECT_
  5. #define _DTABSELECT_
  6.  
  7. #include "DPanel.h"
  8. #include "DCommand.h"
  9. #include "DTracker.h"
  10. #include "DMethods.h"
  11.  
  12.  
  13. class DTableView;
  14.  
  15. class DTabSelection
  16. {
  17. public:
  18.         enum { kNoSelection = -1, 
  19.                 kDontExtend = 0, kExtendSingle = 1, kExtendMulti = 2, 
  20.                 kExtend = kExtendSingle, 
  21.                 kHighlight= true, kSelect= true };
  22.         
  23.         DTabSelection(DTableView* itsTable, long nrows, long ncols);
  24.         virtual ~DTabSelection();
  25.         
  26.         virtual void SetCanSelect( Boolean canrow, Boolean cancol);
  27.         virtual void SetTableSize( long rows, long cols);
  28.         virtual void ChangeRowSize( long atrow, long deltarows);
  29.         virtual void ChangeColSize( long atcol, long deltacols);
  30.             
  31.         virtual long GetSelectedRow();
  32.         virtual long GetSelectedCol();
  33.         virtual void GetFirstSelectedCell( long& row, long& col);
  34.         virtual void GetLastSelectedCell( long& row, long& col);
  35.         virtual Nlm_RecT GetSelRect() const;
  36.  
  37.         virtual void SelectCells( long row, long col, 
  38.                 short extend = kDontExtend, Nlm_Boolean highlight = true, Nlm_Boolean select = true);
  39.         virtual void SelectCells( Nlm_RecT selrect,  
  40.                 short extend = kDontExtend, Nlm_Boolean highlight = true, Nlm_Boolean select = true);
  41.         virtual void SetEmptySelection(Boolean redraw = true);
  42.         virtual void InvalidateSelection();
  43.         virtual Nlm_Boolean IsSelected();
  44.         virtual Nlm_Boolean IsSelected(long row, long col);
  45.         virtual void InvertSelection();
  46.         virtual void InvertSelection(Nlm_RegioN updateRgn);
  47.                 
  48. protected:
  49.         Boolean fCanSelectRow, fCanSelectCol;
  50.         DTableView * fTable;
  51.  
  52.         long        fMaxRows, fMaxCols;
  53.         long        fSelectedRow, fSelectedCol;
  54.         Nlm_RecT    fSelrect;
  55.         Nlm_RegioN    fSelrgn, fWorkrgn;
  56. };
  57.  
  58.  
  59.  
  60.  
  61. class DTabSelector : public DTracker 
  62. {
  63. public:
  64.     enum { cTabSelCmd = 2421 };
  65.     Nlm_RecT    fOldSelection, fNewSelection; //Nlm_RgN later ...
  66.     short     fDoExtend;
  67.     
  68.     DTabSelector( DTableView* itsTable);
  69.     virtual ~DTabSelector();
  70.     virtual void ITabSelector( DTableView* itsTable);
  71.     virtual void Reset(); 
  72.     virtual void DoIt(); 
  73.     virtual void Undo();
  74.     virtual void Redo(); 
  75.     virtual void DoItWork(); 
  76.     virtual void UndoWork(); 
  77. };
  78.  
  79.  
  80.  
  81.  
  82. #endif
  83.